<?php
/**
 * Pert PHP Library
 * Test
 * MySQL Class
 *
 * @author	Emre Hasegeli <hasegeli@gmail.com>
 * @license	GNU General Public License v3
 */

namespace Pert;

require '../MySQL.php';

$mySQL = new MySQL('yunocchi_codex',
		'localhost',
		'5432',
		'yunocchi_codex',
		'DDDDC7p7p');

foreach($mySQL->SelectResultArrayArray('
SELECT *
	FROM users') AS $arrayId => $resultArray)
	foreach($resultArray AS $id => $result)
		echo '<p >' . $arrayId . '|' . $id . '|' . $result . '</p>';

foreach($mySQL->SelectResultArray('
SELECT *
	FROM users
	WHERE username LIKE \'Test%\'') AS $id => $result)
	echo '<p >' . $id . '|' . $result . '</p>';

echo '<p >' . $mySQL->SelectResult('
SELECT userlevel
	FROM users
	WHERE username = ' . $mySQL->SelectInput('Test1')) . '</p>';

echo '<p >' . $mySQL->SelectAffectedRowCount('
UPDATE users
	SET userlevel = userlevel + 1
	WHERE username = \'Test1\'') . '</p>';
